[REFACTOR](schema) Extract overture-schema-validation package - #620
[REFACTOR](schema) Extract overture-schema-validation package#620Seth Fitzsimmons (sethfitz) wants to merge 1 commit into
Conversation
🗺️ Schema reference docs preview is live!
Note ♻️ This preview updates automatically with each push to this PR. |
00b665c to
bfa48f1
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the overture.schema validation API by moving validate() / validate_json() out of the umbrella distribution’s shared namespace root into a new overture-schema-validation distribution (overture.schema.validation), leaving the namespace root as a pkgutil shim to support the planned packaging backend migration.
Changes:
- Added new
overture-schema-validationpackage providingoverture.schema.validation.validate()andvalidate_json(). - Removed implementation code from
packages/overture-schema/src/overture/schema/__init__.py, leaving only the namespace shim. - Updated
overture-schemato depend on the new package and updated tests/imports accordingly.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds overture-schema-validation to workspace members and dependency graph. |
| packages/overture-schema/tests/test_schema_validation.py | Updates tests to import validation API from overture.schema.validation. |
| packages/overture-schema/src/overture/schema/init.py | Removes validation implementation, leaving only pkgutil namespace shim. |
| packages/overture-schema/pyproject.toml | Adds overture-schema-validation as a dependency and workspace source. |
| packages/overture-schema-validation/src/overture/schema/validation/py.typed | Marks the new validation package as typed (PEP 561). |
| packages/overture-schema-validation/src/overture/schema/validation/init.py | New home for the validation implementation. |
| packages/overture-schema-validation/src/overture/schema/init.py | pkgutil namespace shim for overture.schema. |
| packages/overture-schema-validation/src/overture/init.py | pkgutil namespace shim for overture. |
| packages/overture-schema-validation/pyproject.toml | Defines the new distribution and its dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bfa48f1 to
de5e41b
Compare
Alex Iannicelli (atiannicelli)
left a comment
There was a problem hiding this comment.
no longer stacked on #619" ?? Can you verify and update the description?
shouldn't test_schema_validation.py move to the new package too?
|
Both addressed in 8d5a37a. Description fixed — #619 was closed when the annex package was removed (c492317), so this stacks on nothing and targets Moved Two things surfaced while doing that move, both folded into the same commit:
The CLI still carries its own copy of the union-adapter validation logic instead of importing |
8d5a37a to
4ac6cc3
Compare
validate() and validate_json() lived in the overture-schema umbrella's namespace __init__ (src/overture/schema/__init__.py), so the shared overture.schema namespace root carried real code owned by one distribution. Move them into their own overture.schema.validation module in a new overture-schema-validation package; the umbrella now depends on it and its namespace __init__ is a bare pkgutil shim. This separates the aggregator role from the validation API and prepares the namespace root to become code-free -- a precondition for the uv_build migration, where a distribution cannot own code at a shared namespace root. The test and dependencies coupled to that code move with it: - test_schema_validation.py moves into overture-schema-validation/tests/, with the root pythonpath repointed and its pyyaml/yamlcore dev-deps now declared on the new package. - deepdiff moves to overture-schema-common, where its tests actually use it; it was declared in the umbrella's dev group but unused there. - The umbrella is now a bare namespace shim, so its dev group, its vestigial runtime pyyaml and pydantic deps, and its direct overture-schema-common dep are removed -- all still arrive transitively. - overture-schema-validation gets a README. Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
4ac6cc3 to
3198eea
Compare
validate()andvalidate_json()lived in the umbrella distribution's namespace__init__(overture-schema/src/overture/schema/__init__.py), so the sharedoverture.schemanamespace root carried real code owned by one distribution. This moves them into a newoverture-schema-validationpackage (overture.schema.validation); the umbrella now depends on it, and its namespace__init__becomes a bare pkgutil shim.The immediate driver is packaging: freeing the namespace root of owned code is a precondition for the uv_build migration (PR 3), where a distribution cannot own code at a shared namespace root.
Open design question
Whether a standalone
-validationpackage is the right long-term home, or just the minimal way to vacate the root, is worth deciding here rather than assuming. The larger direction this enables — and the reason a dedicated package earns its place beyond "move code off the root":-commonand-systeminto-validation, so those packages carry model/type definitions and this one carries the validation API.[pyspark]extra on this package rather than the separate-pysparkruntime distribution.This PR does none of that consolidation — it takes only the packaging-forced step (vacate the root). The broader move is deliberately out of scope pending agreement on the target shape. Flagging it so the review decides the destination before more code accretes around the current split.
Targets
maindirectly — the #619 layer this originally stacked on was closed when the annex package was removed (c492317), so nothing precedes it now. Closes #622